﻿@{
    Layout = null;
}

<!DOCTYPE html>
@model ElingOA6_Admin_DSJCJ.Model.Task
<html>
<head>
       <title></title>
        @if (false)
    {
        <script src="../../../../Scripts/jquery-vsdoc.js" type="text/javascript"></script>
        <script src="../../../../Scripts/ASPxScriptIntelliSense.js" type="text/javascript"></script>
    }
    <link href="@Url.Content("~/Content/Site.css", true)" rel="stylesheet" type="text/css" />

    <script src="@Url.Content("~/Scripts/jquery.min.js", true)" type="text/javascript"></script>
    <script src="@Url.Content("~/Common/GetRootPath.ashx", true)" type="text/javascript"></script>

    <script src="@Url.Content("~/Scripts/FloatDiv.js", true)" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/regex.js", true)" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/PageCommon.js", true)" type="text/javascript"></script>

    @Html.DevExpress().GetStyleSheets(
        new StyleSheet { ExtensionType = ExtensionType.ListBox }
    )
    @Html.DevExpress().GetScripts(
         new Script { ExtensionType = ExtensionType.ListBox }
    )
        @Html.DevExpress().GetStyleSheets(

        new StyleSheet { ExtensionType = ExtensionType.ListBox, Theme = DevExpressHelper.Theme },
        new StyleSheet { ExtensionType = ExtensionType.GridView, Theme = DevExpressHelper.Theme }
)


<script>

    $(document).ready(function () {
        $("#toolMenu").smartFloat();
        var hdjsAlert = $("#hdjsAlert").val();
        $("#toolMenu").smartFloat();
        if (hdjsAlert == "OK") {
            alert("操作成功");
            window.location.href = rootPath + "/Admin/TaskManager";
        }
        else if (hdjsAlert == "error") {
            alert("操作失败");
        }
        else if (hdjsAlert == "qx") {
            alert("无登记权限！");
            parent.window.location.href = rootPath + "/Admin/TaskManager";
        }
        else if (hdjsAlert == "sj") {
            alert("要求完成时间不可大于登记时间！");
        }
    });

    function OK() {
        form1.submit();
    }

    function MenuTop_emClick(source, e) {
        switch (e.item.name) {
            case "btnSave":
                {
                    //保存
                    OK();
                    break;
                }
            case "btnCancel":
                {
                    window.location.href = rootPath + "/Admin/TaskManager/Index";
                    break;
                }
        }
    }
    function ValueChanged(s, e) {
        var obj = ASPxClientRadioButtonList.Cast(s);
        var value = obj.GetValue()
        if (value == '2') {
            scxx.style.display = 'block'
        }
        else {
            scxx.style.display = 'none'
        }
    }


</script>
</head>
<body>
    @using (Html.BeginForm("Save", "TaskManager", FormMethod.Post, new { id = "form1", @class = "tableFrom", enctype = "multipart/form-data" }))
    {
  <div class="floatToolMenu" id="toolMenu">
        @Html.DevExpress().Menu(settings =>
   {
       settings.Name = "toolBarMenu";
       settings.ItemAutoWidth = false;
       settings.Width = System.Web.UI.WebControls.Unit.Percentage(100);
       settings.Styles.Style.Border.BorderWidth = System.Web.UI.WebControls.Unit.Pixel(0);
       settings.Styles.Style.BorderTop.BorderWidth = System.Web.UI.WebControls.Unit.Pixel(1);
       settings.Items.Add(item =>
       {
           item.Name = "btnSave";
           item.Text = "确定";
           item.ClientEnabled = true;
           item.Image.Url = Url.Content("~/Content/ControlImages/filesave.png");

       });
       settings.Items.Add(item =>
       {
           item.Name = "btnCancel";
           item.Text = "取消";
           item.ClientEnabled = true;
           item.Image.Url = Url.Content("~/Content/ControlImages/no.png");

       });
       settings.ClientSideEvents.ItemClick = "function(source,e){MenuTop_emClick(source,e)}";
       settings.ItemLinkMode = ItemLinkMode.ContentBounds;
   }).GetHtml()
   </div>
    <div>
     <fieldset style="width:100%;" align="center">
            <legend></legend>
            <table class="tableForm">
             <tr>
                <th style=" width:20%">@Html.DevExpress().Label(settings => { settings.Text = "责任科室:"; }).GetHtml()</th>
                <td style=" width:80%" class="tdClass">
             @Html.DevExpress().Label(settings => { settings.Text = Model.FDeptName; }).GetHtml()
                </td> 
            </tr>

            <tr>
                <th>             @Html.DevExpress().Label(settings => { settings.Text = "类别:"; }).GetHtml()</th>
                <td class="tdClass">
                   @Html.DevExpress().Label(settings => { settings.Text = Model.FTaskClassName; }).GetHtml()   
            </tr>
            <tr>
                <th>
                                      @Html.DevExpress().Label(settings => { settings.Text = " 登记时间:"; }).GetHtml() </th>
                <td class="tdClass">
                 @Html.DevExpress().Label(settings => { settings.Text = Model.FInsDateStr; }).GetHtml()  
                </td>
            </tr>
            <tr>
                <th>
                                   @Html.DevExpress().Label(settings => { settings.Text = "要求完成时间:"; }).GetHtml()</th> 
                <td class="tdClass">
   @Html.DevExpress().Label(settings => { settings.Text = Model.FEndDateStr; }).GetHtml()
                    </td>

</tr>
            <tr>
            <th>   @Html.DevExpress().Label(settings => { settings.Text = "分值:"; }).GetHtml()</th>
                <td  class="tdClass">
    @Html.DevExpress().Label(settings => { settings.Text = Model.FScore.ToString(); }).GetHtml()
                               </td>
            </tr>
            <tr>
                <th>   @Html.DevExpress().Label(settings => { settings.Text = "详细内容"; }).GetHtml()
                    </th>
                <td class="tdClass">
  @Html.DevExpress().Label(settings => { settings.Text = Model.FContent; }).GetHtml()
                </td>
              </tr>
            
    </table>
                </fieldset>
    </div>
    <div>
       <fieldset style="width:100%;" align="center">
            <legend>@Html.DevExpress().Label(settings => { settings.Text = "完成情况"; }).GetHtml()</legend>
            <table>

                @foreach (ElingOA6_Admin_DSJCJ.Model.TaskDo TaskDomodel in ViewData["TaskDoList"] as List<ElingOA6_Admin_DSJCJ.Model.TaskDo>)
                {
                <tr>
                <td style=" font-size:12px">           
                     <strong> [@TaskDomodel.FStatusStr]@TaskDomodel.FInsDate] </strong> @TaskDomodel.FNote 
              </td>
                </tr>
                }
            
            <tr>
            <td>
            <font color=red>@Html.DevExpress().Label(settings => { settings.Text = Model.FStatusStr; }).GetHtml()</font>
            </td>
            </tr>
           @foreach (ElingOA6_Admin_DSJCJ.Model.TaskAttach TaskAttachmodel in ViewData["TaskAttachList"] as List<ElingOA6_Admin_DSJCJ.Model.TaskAttach>)
           {
                <tr>
                <td>
              @Html.DevExpress().Label(settings => { settings.Text = "相关资料:"; }).GetHtml() <a href="@TaskAttachmodel.FAttachSvrFileName">@TaskAttachmodel.FAttachOldFileName</a>
              </td>
                </tr>
           }
            </table>
       </fieldset>
    </div>
    <div>
            <fieldset style="width:100%;" align="center">
            <legend>@Html.DevExpress().Label(settings => { settings.Text = "办理"; }).GetHtml()</legend>
                      @Html.DevExpress().RadioButtonList(settings =>
                 {
                     settings.Name = "FStatus";
                     settings.Properties.RepeatLayout = System.Web.UI.WebControls.RepeatLayout.Table;
                     settings.Properties.RepeatDirection = System.Web.UI.WebControls.RepeatDirection.Horizontal;
                     settings.Properties.RepeatColumns = 3;
                     settings.Properties.ValueField = "Value";
                     settings.Properties.TextField = "Text";
                     settings.Properties.ClientSideEvents.ValueChanged = "function(s,e){ValueChanged(s,e)}";
                     settings.Width = System.Web.UI.WebControls.Unit.Pixel(400);
                     settings.Properties.Style.Border.BorderColor = System.Drawing.Color.White;
                     settings.SelectedIndex = 0;
                 }).BindList(new List<SelectListItem> { 
                            new SelectListItem { Text = "正在处理", Value = "1" }, 
                            new SelectListItem { Text = "完成", Value = "2" },
                            new SelectListItem { Text = "未完成", Value = "3" }
     }).GetHtml()

          @Html.DevExpress().Memo(settings =>
     {
         settings.Name = "FNote";
         settings.Text = "";
         settings.Width = System.Web.UI.WebControls.Unit.Percentage(90);
         settings.Height = System.Web.UI.WebControls.Unit.Pixel(60);
     }).GetHtml()
<div  id="scxx" style="display:none">
<table>
<tr>
<td>@Html.DevExpress().Label(settings => { settings.Text = "最终办结文档:"; }).GetHtml()</td>
<td><input type="file" name="fj" />@Html.DevExpress().Label(settings =>
                              {
                                  settings.Text = "（涉及资科整理、上报等相关事项请上传最终文档）";
                                  settings.Properties.Style.ForeColor = System.Drawing.Color.Blue;
                              }).GetHtml()</td>
</tr>
</table>
</div>
            </fieldset>                                  
    </div>


        @Html.Hidden("hdMethod", ViewData["hdMethod"])
        @Html.Hidden("hdjsAlert", (ViewData["jsAlert"]))      
        @Html.Hidden("hdFTaskID", Model.FTaskID)  
    }
</body>
</html>
